//app.js
var util = require('utils/util.js')   //引入配置公共请求接口
var configUrl = require('./config/config')  //引入配置接口文件
const bmap = require('./common/bmap-wx.min')     //百度地图API

const mapObj = new bmap.BMapWX({
  ak: 'EyXNEUOmM9ynOm0GW1r1pTxc6ih4EHxz'
});
const miniShopPlugin = requirePlugin('mini-shop-plugin');
App({
  //封装请求方式-form 及 json
  reqFun:{
    requestForm:util.requestForm,
    requestJson:util.requestJson, // 传参方式  ..thisObj.reqFun.requestJson('POST','接口地址','请求参数',()=>{})
  },
  onLaunch: function (options ) {
    miniShopPlugin.initHomePath('/pages/newIndex/newIndex');
    miniShopPlugin.initApp(this, wx);
    wx.removeStorageSync('firstAccessServerTime')
  // 判断是否由分享进入小程序
    if (options.scene==1011 || options.scene==1012 || options.scene==1013 || options.scene==1047 ||options.scene==1048 || options.scene==1049  || options.scene==1073  || options.scene==1074|| options.scene==1044|| options.scene==1007|| options.scene==1008|| options.scene==1036) {
      var scene = decodeURIComponent(options.query.scene)//参数二维码传递过来的参数
      if(scene){   //是否为分享二维码进入
        this.reqFun.requestJson("GET",configUrl.getParamByScene+scene,'',(res)=>{
          if(res.data.success==1){
            if(res.data.data){
              this.globalData.share = true
              wx.setStorageSync('shearData', res.data.data)
              // this.initLogin()    //初始化登录
              // this.getUserLocation()  //定位
            }

          }
        })
      }
    }else if(options.scene == 1007 || options.scene == 1008){
      this.globalData.share = true
      // this.initLogin()    //初始化登录
      // this.getUserLocation()  //定位
    } else{
      this.globalData.share = false
      this.globalData.partnerInfo= {}

      // this.initLogin()    //初始化登录
      // this.getUserLocation()  //定位
    };


  //获取设备顶部时间栏的高度
    wx.getSystemInfo({
      success: e => {
        this.globalData.statusHeight =e.statusBarHeight
        this.globalData.height = e.statusBarHeight
        this.globalData.StatusBar = e.statusBarHeight;
        this.globalData.windowWidth=e.windowWidth
        let capsule = wx.getMenuButtonBoundingClientRect();
        var model=e.model
        if (model.search('iPhone X') != -1) {
          this.globalData.isIPX = true
          this.globalData.isIPXBottom = '68rpx'
          this.globalData.isIPXBottom2 = 68
        }
		if (capsule) {
		 	this.globalData.Custom = capsule;
			this.globalData.CustomBar = capsule.bottom + capsule.top - e.statusBarHeight;
		} else {
			this.globalData.CustomBar = e.statusBarHeight + 50;
		}
      }
    })
    this.getSystemInfo();
    // 获取模板id
    this.getAllMsgTemplate();
  },

//获取合伙人信息
getPartnerInfo: function (data) {
  const userId = data
  if(!userId)return
  let that = this;
  this.reqFun.requestJson('get',configUrl.getPartnerInfo + userId, '', (res) => {
    if (res.data.success == 1) {
      var partnerInfo = {
        id: wx.getStorageSync('loginMsg').userId||'',
        partnerNickName: res.data.data.partnerNickName||res.data.data.nickname,
        partnerPhone: res.data.data.partnerPhone||res.data.data.phone,
        partnerPhoto: res.data.data.partnerPhoto||'',
        partnerQrCode: res.data.data.partnerQrCode||'',
      }
      that.globalData.partnerInfo= partnerInfo
      console.log('app嘻嘻嘻', that.globalData.partnerInfo)
    }
  }, true)
},
  onShow:function(options){
    const updateManager = wx.getUpdateManager()
    if (updateManager) {
      updateManager.onCheckForUpdate(function (res) {
          // 请求完新版本信息的回调
      })

      updateManager.onUpdateReady(function () {
          wx.showModal({
              title: '更新提示',
              content: '新版本已经准备好，是否重启应用？',
              success: function (res) {
                  if (res.confirm) {
                      // 新的版本已经下载好，调用 applyUpdate 应用新版本并重启
                      updateManager.applyUpdate()
                  }
              }
            })
      })

      updateManager.onUpdateFailed(function () {
        // 新版本下载失败
      })
    }
    wx.removeStorageSync('temporaryAddressData')
    wx.removeStorageSync('wholeHouseData')
    wx.removeStorageSync('submitSku')
    wx.removeStorageSync('nowBuyDepositSku')
    // 判断是否由分享进入小程序
    this.globalData.shareUserId=''
    if (options.scene==1011 || options.scene==1012 || options.scene==1013 || options.scene==1047 ||options.scene==1048 || options.scene==1049  || options.scene==1073  || options.scene==1074|| options.scene==1044||options.scene==1036){
      // 如果为分享进入app，保存分享人信息userId
      this.globalData.shareUserId=options.query.hid||''
        var scene = decodeURIComponent(options.query.scene)//参数二维码传递过来的参数
        if(scene){   //是否为分享二维码进入
          this.reqFun.requestJson("GET",configUrl.getParamByScene+scene,'',(res)=>{
            if(res.data.success==1){
              if(res.data.data){
                this.globalData.share = true
                wx.setStorageSync('shearData', res.data.data)
                this.globalData.shareUserId=res.data.data.userId||options.query.hid||''
                this.getPartnerInfo(this.globalData.shareUserId||'')
                this.initLogin()    //初始化登录
                this.getUserLocation()  //定位
              }
            }
          })
        }else{
          this.globalData.share = false
          this.globalData.partnerInfo= {}
          this.initLogin()    //初始化登录
          this.getUserLocation()  //定位
        }
      }else if(options.scene == 1007 || options.scene == 1008){
        this.globalData.share = true
        this.globalData.shareUserId=options.query.hid||''
        this.getPartnerInfo(this.globalData.shareUserId||'')
        this.initLogin()    //初始化登录
        this.getUserLocation()  //定位
      }else{
        this.globalData.share = false
        this.globalData.partnerInfo= {}
        this.initLogin()    //初始化登录
        this.getUserLocation()  //定位
      };

      this.getListOfval()
  },
  //获取默认地理位置
  getUserLocation:function(callback){
    let that = this
    wx.getSetting({
      success(res) {
        if (res.authSetting['scope.userLocation'] == true) {
          that.getRealLocation(callback)
        } else {
          that.getDefultLocation(callback)
        }
      },
      fail(res) {
        that.getDefultLocation(callback)
      }
    })
  },
  //获取默认地址
  getDefultLocation: function(callback) {
    wx.setStorageSync('getLocation', 'Y')
    var that=this;
    //默认辽宁省大连市西岗区日新街道
    const locationInfo = {"latitude":38.9189536667856,"longitude":121.62163148459286,"speed":-1,"accuracy":65,"verticalAccuracy":65,"horizontalAccuracy":65,"errMsg":"getLocation:ok"}
    wx.setStorageSync('locationInfo', locationInfo)
    var BMap=util.qqMapTransBMap(locationInfo.latitude, locationInfo.longitude)
    const latitude = BMap.latitude
    const longitude = BMap.longitude
    wx.setStorageSync('latAndLong', {'longitude':longitude,"latitude":latitude})
    var parms={latitude:latitude,longitude:longitude}
    that.reqFun.requestJson('get',configUrl.getAddrCode,parms,(res)=>{
      if(res.data.success == 1){
        wx.setStorageSync('addrCode', res.data.data)
      }
      if (callback) {
        callback()
      }
    })
  },
  //获取真实地理位置
  getRealLocation: function(callback){
    wx.setStorageSync('getLocation', 'Y')
    var that=this;
    wx.getSetting({
      success (res){
        console.log('用户设置权限res', res)
        if (res.authSetting['scope.userLocation'] != false) {
          if (wx.getStorageSync('realAddressTime') && Date.now() - wx.getStorageSync('realAddressTime') < 30000) {
            console.log('30秒内不重复定位')
            callback()
            return
          }
          wx.getLocation({
            type: 'wgs84',
            success (res) {
              wx.setStorageSync('locationInfo', res)
              var BMap=util.qqMapTransBMap(res.latitude,res.longitude)
              const latitude = BMap.latitude
              const longitude = BMap.longitude
              wx.setStorageSync('latAndLong', {'longitude':longitude,"latitude":latitude})
              var parms={latitude:latitude,longitude:longitude}
              that.reqFun.requestJson('get',configUrl.getAddrCode,parms,(res)=>{
                if(res.data.success==1){
                  wx.setStorageSync('addrCode', res.data.data)
                  wx.setStorageSync('realAddressTime', Date.now())
                  if (callback) {
                    callback({
                      'showSetting': false
                    })
                  }
                }
              })
            },
            fail (res) {
              console.log('定位出错：', res)
              //用户已授权，但是获取地理位置失败，提示用户去系统设置中打开定位
              wx.showModal({
                title: '',
                content: '若要获取定位请您在系统设置中打开定位服务，并允许定位',
                confirmText: '确定',
                success: function (res) {
                }
              })
              if (callback) {
                callback({
                  'showSetting': true
                })
              }
              wx.setStorageSync('getLocation', 'N')
            }
          })
        }else{
          wx.setStorageSync('getLocation', 'N')
          if (callback) {
            callback({
              'showSetting': true
            })
          }
        }
      }
    })
  },
  // 获取用户信息-注册（验证登录状态后  需要登录 调用此方法）
  getUserInfo:function(callback, callbackParam){
    var that=this;
    wx.getUserInfo({
      lang:"zh_CN",
      success: function(res) {
        wx.setStorageSync('userInfo', res)
        var encryptedData=res.encryptedData
        var iv=res.iv
        wx.login({
          success:function(e){
            that.reqFun.requestJson('POST',configUrl.loginAuth,{"js_code":e.code},(resp)=>{
              if(resp.data.success==1){
                wx.setStorageSync('loginMsg', resp.data.data)
                var postData={
                  encryptedData:encryptedData,
                  iv:iv,
                  session_key:resp.data.data.session_key
                }
                // 注册登录-首次进入需注册-如已注册 直接登录
                that.reqFun.requestJson('POST',configUrl.bandingUserInfo,postData,(re)=>{
                  if(re.data.success==1){
                    wx.setStorageSync('loginMsg', re.data.data)
                    wx.setStorageSync('showGetPhone', true)
                    if (callback) {
                      callback(callbackParam)
                    }
                    // setTimeout(function(){
                    //   if(that.globalData.share){
                    //     var shareId=wx.getStorageSync('shearData').userId
                    //     that.bindingPartner(shareId)
                    //   }
                    // },2000)
                    // that.updateUserAddr()
                  }
                })
              }else{
                wx.showToast({
                  title: '登录失败',
                  icon:'none',
                  duration:3000
                })
              }
            })
          }
        })
      }
    })
  },
  bindingPartner:function(bindingUser){   //绑定合伙人
    var that=this;
    //修改逻辑：用户有id则可绑定合伙人
    if(wx.getStorageSync('loginMsg').userId){
      var parms={
        userId:wx.getStorageSync('loginMsg').userId,
        invitationId:bindingUser,
        appOption:wx.getLaunchOptionsSync()
      }
      that.reqFun.requestJson('POST',configUrl.partnerBinding,parms,(res)=>{
        if(res.data.success==1){
          console.log('绑定合伙人成功')
        }else{
          console.log('绑定合伙人失败')
        }
      })
    }
  },
  //新的用户信息获取接口
  getUserProfile:function(callBack){
    var that=this;
    wx.getUserProfile({
      desc: '获取用户信息',
      success: function(msg){
        let userInfo = msg.userInfo
        userInfo.openId = wx.getStorageSync('loginMsg').openid
        that.reqFun.requestJson('POST',configUrl.saveUserInfo,userInfo,(res)=>{
          if(res.data.success==1){
            if (!res.data.bindingPhone) {
              wx.setStorageSync('showGetPhone', true)
              wx.setStorageSync('loginMsg', res.data.data)
              //调用登录获取sessionKey
              that.initLogin(true)
              callBack()
            }
          }else{
          }
        })
      },
      fail:function(e){
        console.log('getUserProfile失败', e)
      }
    })
  },
  //初始化登录 skipUpdateAddr=true 则跳过更新地址
  initLogin:function(skipUpdateAddr){    //初始化登录
    var that=this;
    //初始化登录微信获取openid
    wx.login({
      success:function(e){
        that.reqFun.requestJson('POST',configUrl.loginAuth,{"js_code":e.code},(res)=>{
          if(res.data.success==1){
            wx.setStorageSync('loginMsg', res.data.data)
            // setTimeout(function(){
            //   if(that.globalData.share){
            //     if (bindPartiner) {
            //       var shareId=wx.getStorageSync('shearData').userId
            //       that.bindingPartner(shareId)
            //     }
            //   }
            // },2000)
            if (!skipUpdateAddr) {
              var setLoginLog=setInterval(()=>{
                if(wx.getStorageSync('loginMsg').token && wx.getStorageSync('addrCode').province){
                  that.updateLoginLog()
                  clearInterval(setLoginLog)
                }
              },1000)
              that.updateUserAddr()
            }
          }
        })
      }
    })
  },
  // 更新登录日志
  updateLoginLog(){
    this.reqFun.requestJson('GET',configUrl.loginLog,'',(res)=>{
     console.log('更新登录日志',res)
    })
  },
  getListOfval(type){
    var that=this
    that.reqFun.requestJson('GET',configUrl.qpuListOfVal+(type?type:'all'),'',(res)=>{
      if(res.data.success==1){
        that.globalData.valLsit=res.data.data
      }
    })
  },
  updateUserAddr(){   //更新用户定位-统计使用
    var that=this
    var parms={}
    var setFun=setInterval(()=>{
      if(wx.getStorageSync('addrCode').province){
        var add=wx.getStorageSync('addrCode')
        clearInterval(setFun)
        parms.address=add.province+add.city+add.district+add.street+add.streetNumber
        that.reqFun.requestJson('POST',configUrl.updateUserAddr,parms,(res)=>{
          if(res.data.success==1){
            console.log('更新统计定位成功')
          }
        })
      }
    },1000)

  },
  getLogin(callback){   //登录调用 - 弹出登录窗
    if(!wx.getStorageSync('loginMsg').loginState){
      return callback(false)   //需要登录
    }else{
      return callback(true)      //已登录
    }
  },
  // 获取系统信息
  getSystemInfo: function () {
    let t = this;
    wx.getSystemInfo({
      success: function (res) {
        t.globalData.systemInfo = res;
        t.globalData.statusBarHeight = res.statusBarHeight
        t.globalData.screenWidth = res.screenWidth
        t.globalData.screenHeight = res.screenHeight
      }
    });
  },
  // 获取二维码参数
  getShareCode(e,callback){
    var scene=e
    this.reqFun.requestJson("GET",configUrl.getParamByScene+scene,'',(res)=>{
      if(res.data.success==1){
        if(res.data.data){
          this.globalData.share = true
          callback(res.data.data)
        }
      }
    })
  },
  // 查询全部订阅模板
  getAllMsgTemplate() {
    let that = this
    that.reqFun.requestJson("GET",configUrl.queryAllTemplate,'',(res)=>{
      if(res.data.success==1){
        if(res.data.data){
          that.globalData.msgTemplateMap = res.data.data.templateMap
          wx.setStorageSync('firstAccessServerTime', res.data.data.firstAccessServerTime)
        }
      }
    })
  },
  // 询问订阅待支付提醒
  unPayNotifySubscribe(callback, orderId) {
    let that = this
    // 订阅模板id(微信)，及编码(后端)
    let tempIds = []
    let tempCodes = []
    let miniUnPay = that.globalData.msgTemplateMap['miniUnPay']
    tempIds.push(miniUnPay.msgTemplateId)
    tempCodes.push(miniUnPay.msgSceneType)
    wx.requestSubscribeMessage({
      tmplIds: tempIds,
      success(res) {
        // 同意订阅待支付提醒
        tempCodes.forEach(tempCode => {
          let templateNew = that.globalData.msgTemplateMap[tempCode]
          templateNew.subscribeStatus = res[templateNew.msgTemplateId]
          templateNew.msgSceneFromId = orderId
          that.insertSubscribeRecord(templateNew)
        })
        if (callback) {
          callback()
        }
      },
      fail(err) {
        // 拒绝订阅待支付提醒
        tempCodes.forEach(tempCode => {
          var templateNew = that.globalData.msgTemplateMap[tempCode]
          templateNew.subscribeStatus = 'error'
          templateNew.subscribeErrCode = err.errCode
          templateNew.msgSceneFromId = orderId
          that.insertSubscribeRecord(templateNew)
        })
        if (callback) {
          callback()
        }
      }
    })
  },
  // 询问订阅支付后更多提醒
  moreOrderNotifySubscribe(callback, orderId, orderType) {
    let that = this
    // 订阅模板id(微信)，及编码(后端)
    let tempIds = []
    let tempCodes = []

    // 订单发货提醒
    let miniOrderSend = that.globalData.msgTemplateMap['miniOrderSend']
    tempIds.push(miniOrderSend.msgTemplateId)
    tempCodes.push(miniOrderSend.msgSceneType)
    // 确认收货提醒
    let miniConfirmReceived = that.globalData.msgTemplateMap['miniConfirmReceived']
    tempIds.push(miniConfirmReceived.msgTemplateId)
    tempCodes.push(miniConfirmReceived.msgSceneType)

    if (orderType === 4) {
      // 拼购团结果提醒
      let miniSpellBuyGroup = that.globalData.msgTemplateMap['miniSpellBuyGroup']
      tempIds.push(miniSpellBuyGroup.msgTemplateId)
      tempCodes.push(miniSpellBuyGroup.msgSceneType)
    }

    wx.requestSubscribeMessage({
      tmplIds: tempIds,
      success(res) {
        // 同意订阅支付后更多提醒
        tempCodes.forEach(tempCode => {
          let templateNew = that.globalData.msgTemplateMap[tempCode]
          templateNew.subscribeStatus = res[templateNew.msgTemplateId]
          // 传入订单id，后台找到对应参团id
          templateNew.msgSceneFromId = orderId
          that.insertSubscribeRecord(templateNew)
        })
        if (callback) {
          callback()
        }
      },
      fail(err) {
        // 拒绝订阅支付后更多提醒
        tempCodes.forEach(tempCode => {
          var templateNew = that.globalData.msgTemplateMap[tempCode]
          templateNew.subscribeStatus = 'error'
          templateNew.subscribeErrCode = err.errCode
          templateNew.msgSceneFromId = orderId
          that.insertSubscribeRecord(templateNew)
        })
        if (callback) {
          callback()
        }
      }
    })
  },
  // 询问订阅砍价成功提醒
  cutPriceNotifySubscribe(callback, cutPriceGroupId) {
    let that = this
    // 订阅模板id(微信)，及编码(后端)
    let tempIds = []
    let tempCodes = []

    // 砍价成功提醒
    let miniCutPriceGroup = that.globalData.msgTemplateMap['miniCutPriceGroup']
    tempIds.push(miniCutPriceGroup.msgTemplateId)
    tempCodes.push(miniCutPriceGroup.msgSceneType)
    //检查没有订阅过才触发订阅
    that.checkExistSubscribeRecord(miniCutPriceGroup.msgSceneType, cutPriceGroupId, (onlyLastCallback) => {
      if (onlyLastCallback && callback) {
        callback()
        return
      }
      wx.requestSubscribeMessage({
        tmplIds: tempIds,
        success(res) {
          // 同意订阅砍价成功提醒
          tempCodes.forEach(tempCode => {
            let templateNew = that.globalData.msgTemplateMap[tempCode]
            templateNew.subscribeStatus = res[templateNew.msgTemplateId]
            templateNew.msgSceneFromId = cutPriceGroupId
            that.insertSubscribeRecord(templateNew)
          })
          if (callback) {
            callback()
          }
        },
        fail(err) {
          // 拒绝砍价成功提醒
          tempCodes.forEach(tempCode => {
            var templateNew = that.globalData.msgTemplateMap[tempCode]
            templateNew.subscribeStatus = 'error'
            templateNew.subscribeErrCode = err.errCode
            templateNew.msgSceneFromId = cutPriceGroupId
            that.insertSubscribeRecord(templateNew)
          })
          if (callback) {
            callback()
          }
        }
      })
    })
  },
  // 询问券过期提醒 fromId为订单(父单)id或者券id
  couponNotifySubscribe(callback, fromId, getCoupon) {
    let that = this
    if (!getCoupon) {
      let endTimeLong = that.globalData.getListvalue(that.globalData.valLsit, 'DEPOSIT_COUPON_USE_AGE_CONFIG')
      if (endTimeLong[0].name == '0') {
        if (callback) {
          callback()
        }
        return
      }
    }
    // 订阅模板id(微信)，及编码(后端)
    let tempIds = []
    let tempCodes = []

    //定金订单 优惠券即将过期提醒
    let miniCouponTimeOuting = that.globalData.msgTemplateMap['miniCouponTimeOuting']
    tempIds.push(miniCouponTimeOuting.msgTemplateId)
    tempCodes.push(miniCouponTimeOuting.msgSceneType)

    wx.requestSubscribeMessage({
      tmplIds: tempIds,
      success(res) {
        // 同意券过期提醒
        tempCodes.forEach(tempCode => {
          let templateNew = that.globalData.msgTemplateMap[tempCode]
          templateNew.subscribeStatus = res[templateNew.msgTemplateId]
          templateNew.msgSceneFromId = fromId
          if (getCoupon) {
            templateNew.msgSceneFrom = 'COUPON'
          }
          that.insertSubscribeRecord(templateNew)
        })
        if (callback) {
          callback()
        }
      },
      fail(err) {
        // 拒绝券过期提醒
        tempCodes.forEach(tempCode => {
          var templateNew = that.globalData.msgTemplateMap[tempCode]
          templateNew.subscribeStatus = 'error'
          templateNew.subscribeErrCode = err.errCode
          templateNew.msgSceneFromId = fromId
          if (getCoupon) {
            templateNew.msgSceneFrom = 'COUPON'
          }
          that.insertSubscribeRecord(templateNew)
        })
        if (callback) {
          callback()
        }
      }
    })
  },
  // 将订阅记录保存到后端
  insertSubscribeRecord(template) {
    let that = this
    that.reqFun.requestJson("POST",configUrl.insertSubscribeRecord,template,(res)=>{
      if(res.data.success==1){
        console.log('保存成功', template.msgSceneType)
      }
    })
  },
  // 将分享记录保存到后端
  insertShareRecord(pagePath, pageQuery, resourceId, resourceType, userId) {
    let that = this
    let record = {
      'pagePath': pagePath,
      'pageQuery': pageQuery,
      'resourceId': resourceId,
      'resourceType': resourceType,
      'userId': userId
    }
    that.reqFun.requestJson("POST",configUrl.insertShareRecord,record,(res)=>{
      if(res.data.success==1){
        console.log('保存成功', record.resourceType)
      }
    })
  },
  // 查询是否已询问过订阅
  checkExistSubscribeRecord(msgSceneType, msgSceneFromId, callback) {
    let that = this
    let template = {
      "msgSceneType": msgSceneType,
      "msgSceneFromId": msgSceneFromId
    }
    that.reqFun.requestJson("POST",configUrl.checkExistSubscribeRecord,template,(res)=>{
      if (res.data.success == 1 && !res.data.data) {
        if (callback) {
          callback(false)
        }
      } else {
        callback(true)
      }
    })
  },
  //保存访问足迹记录
  saveAccessFootprint(accessUuid, footprintType, resourceId) {
    let pages = getCurrentPages();
    let currentPage = pages[pages.length-1];
    let that = this
    if (!accessUuid) {
      return
    }
    let footprintRecord = {
      "uuid": accessUuid,
      "pagePath": currentPage.route,
      "pageOptions": JSON.stringify(currentPage.options),
      "type": footprintType,
      "resourceId": resourceId,
    }
    that.reqFun.requestJson("POST",configUrl.saveAccessFootprint,footprintRecord,(res)=>{
      //仅记录
    })
  },
  //保存退出足迹记录
  saveQuitFootprint(accessUuid) {
    let that = this
    if (!accessUuid) {
      return
    }
    let footprintRecord = {
      "uuid": accessUuid
    }
    that.reqFun.requestJson("POST",configUrl.saveQuitFootprint,footprintRecord,(res)=>{
      //仅记录
    })
  },
  globalData: {
    // comUrl:'http://192.168.99.59:7002',     //本地调试
    img: "/image/imgs/", //图片路径，最后将图片放在服务器上，替换成网络路径前缀
    imgUrl: "https://testimg.quanyou.com.cn/",  //测试服  调试路径
    // imgUrl: "https://gcenterimg.quanyou.com.cn/",  //正式服  发版路径
    BgimgUrl: 'https://gcenterimg.quanyou.com.cn/img_source/',
    videoUrl: 'https://filedev.quanyou.com.cn/',  // 测试服 视频
    height:0,  //顶部时间栏高度
    share:false,  //是否是分享进来
    showSetting:false,
    getListvalue: util.getListvalue, // 获取相应值列表
    formatTime: util.formatTime,
    screenHeight:'',
    toCrmPage:'',
    valLsit: [],
    msgTemplateMap: null
  }
})


